Authoring tool for computer implemented decision management system

ABSTRACT

An authoring method and apparatus for creating an application for a decision management system such as a document assembly system. The method includes creating sets of question procedures, answer procedures and advice procedures for a particular application. When later executed, the procedures generate, respectively, questions, answer choices, and advice for a user of the application. Also created are procedures that may be referenced in on or more of the question, answer, or advice procedures for generating content based on an analysis of one or more answers previously provided by a user in response to a question. The content provided by these referenced procedures becomes part of the question, answer, or advice provided by the respective procedure making the reference. In this way the content of the questions, answers, and advice changes depending upon previous answers given by a user to previous questions. And because the question, answer, and advice procedures reference procedures rather than variables, the content provided by the referenced procedure is not limited to being merely a copy of an answer to a previous question.

This is a division, of application No. 08/377,489, filed Jan. 24, 1995,now abandoned, which is a continuation of application No. 07/957,508,filed Oct. 5, 1992, now abandoned.

BACKGROUND OF THE INVENTION

This invention relates to computer-based systems that use aquestion-and-answer format and/or complete a user task such as preparinga legal opinion, assembling a document, rendering a medical diagnosis,or conducting educational training and evaluation sessions. Moreparticularly, this invention relates to a system that assists the userin exercising professional judgment in the course of completing a task,rather than the system itself merely making decisions based on userinput. By permitting the user to exercise intellectual control overdecisions made in the process of completing the task, by efficientlyinforming the user about the professional judgment required, and byassisting in the timely exercise of that judgment, the systemeffectively combines the knowledge base of a computer system with theexpertise and experience of the user. The system combines: (1) anexecution component (herein called the "execution program") with (2) atask-specific component (herein called "application programs") toaccomplish tasks for the user, and includes (3) an application authoringcomponent (herein called the "authoring program") for the generation of"application programs" that may be used in conjunction with the"execution program" to accomplish their assigned tasks for the user. Thesystem allows for the creation and use of concise application programsthat solicit preliminary factual input from the user. It then managesthe process of coupling that factual input with the application author'sexpertise embedded within applications, and, together with the user'sjudgment (effectively informed and obtained during execution by thesystem), swiftly and economically performs the assigned task.

Computer-based decision making systems, often known as expert systems,provide advice or opinion based on facts entered into the system by theuser. If the user's task, for example, is to diagnose a medicalcondition, the system prompts the user for pertinent information. Itthen renders an opinion based on the facts provided by the user and theknowledge base (usually a set of rules) of the system. Such expertsystems have been used in a variety of fields, including the preparationof legal documents such as contracts, licenses, etc. These particularsystems are commonly known as expert-based document assembly systems.

Such prior systems (particularly document assembly systems) havesuffered from a number of drawbacks that have limited their usefulness.One drawback is the lack of available application programs (also knownas packages) for users. Application programs may either be writtendirectly using a programming language such as C or may be created usinganother computer program known as an authoring program. Typically,authors that can provide the expertise for an application, such asexperienced lawyers, scientists and medical doctors, are not skilledcomputer programmers. Authoring programs attempt to simplify the writingof application programs so that their authors can write applicationprograms with minimal training. However, prior authoring programs haveoften been too complex to be useful, and as a result few applicationshave been written. The application programs that must be authored usingprior systems necessarily are complex structures themselves--requiringsubstantial computer programming skill of their authors to deal with amultitude of ordinary aspects of computer implementation.

Another drawback of such prior systems has been their deterministicnature. As described above, such systems prompt a user for facts andthen apply a series of rules to determine appropriate answers. In termsof preparing a document, these answers represent provisions that areincluded in the document. The user is not given the opportunity toexercise professional judgment as to the desirability of a provision.For example, a provision in an employment contract may or may not bedesirable, depending on subtleties not available to the system. Only theuser, experienced in evaluating the subtleties and well informed as totheir implication, can make the ultimate decision whether to includesuch a provision, and yet present systems neither well inform the usernor allow for such user judgment. The result is that the documentprovided by the system must often be heavily edited, and hence the valueof the system to the user is considerably less than hoped.

This invention overcomes these drawbacks. It provides an authoringprogram that is simple to use for preparing application programs. Thisinvention's application programs may be very concise structures notrequiring their authors to be concerned with the ordinary aspects ofother computer implementation. It also allows the professional judgmentof the user to be combined with the knowledge base of the system incompleting the task at hand, whether that task is providing a medicaldiagnosis, a training session, a professional opinion or an assembledlegal document.

SUMMARY OF THE INVENTION

An object of the invention, therefore, is to provide a simple,easy-to-use authoring program for writing applications for acomputer-assisted decision management advice system such as a documentassembly system.

Another object of the invention is to provide such an authoring toolthat simplifies the design of applications so that an application may beeasily reviewed for improvement or for errors.

Yet another object of the invention is to provide a decision managementsystem that permits and assists a user to exercise informed judgment inthe completion of the task rather than just provide facts in answeringquestions posed by the system.

Yet another object of the invention is to provide a decision managementsystem that "learns" from answers provided by a user in creatingfollow-up questions and advice.

To achieve these objects, a novel computer-based method for assisting auser in making decisions in the process of completing a task is shownand described herein. The system has wide applicability includingtraining, education, diagnosis, etc. The method of the inventionincludes providing a set of questions for completing the task, askingthe user a first question from the set, and providing a choice ofanswers to the first question for the user and advice from the system'sknowledge base for deciding which of the answers to the first questionto select. The choice of answer, however, remains under the control ofthe user, who can exercise professional judgment based on priorknowledge and advice provided by the decision management system.

The method proceeds with asking the user following questions such as asecond question from the question set. The second question is determinedin part by the user's answer to the first question. For example, thesecond question may need to make reference to a fact the user hassupplied in answer to the first question. Or the question selected bythe system may change depending on the user's first answer. Whatever theeffect of the first answer, the user is then provided a choice ofanswers to the second question, with one or more of the answersdetermined in part by the user's answer to the first question. The useris also provided advice for assistance in choosing an answer to thesecond question, the advice also determined in part by the user's answerto the first question.

The method then continues as described, with following questions,answers and advice influenced by the user's previous answers. Throughoutthe decision-making process, the user retains control of the answers ifso desired, with the system providing advice from its knowledge base forassistance in answering a question.

Although a decision management system according to the invention hasmany uses, it is particularly suited for document assembly. That is, thesystem allows an experienced lawyer or other professional to determinewhat provisions are suitable for a document such as a contract orlicense. This determination is based on the facts provided by thelawyer, judgments made by the lawyer while using the system, and thelegal knowledge base of the system. Ultimately the lawyer choosesprovisions based on professional judgment with the assistance of thesystem. A document can be assembled with the invention much faster andmore efficiently than with traditional methods of researching the legaleffects and cross effects of various provisions.

This decision management system also includes a novel authoring programfor preparing applications. Using an intuitive program block approachand index, an author can construct an application by placing questions,answer, choices, advice and provisions in program blocks each uniquelyidentified by name. The author then arranges and assembles these blocksto build an application program. The logic of the application is simpleto review, allowing efficient editing and error-checking. Authors do notneed prior computer training to use the authoring program. Hence,persons with the desired expertise in fields such as law, education andmedicine can readily write applications for the decision managementsystem.

The foregoing and other objects, features, and advantages of theinvention will become more apparent from the following detaileddescription of a preferred embodiment which proceeds with reference tothe accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of the overall software architecture of adecision management system according to the invention.

FIG. 2 is a screen display of a user interface used in an authoringprogram of the decision management system for writing applicationprograms.

FIG. 3 is a block diagram of the software architecture of an executionprogram of the decision management system for executing applicationprograms.

FIG. 4 is a block diagram of the software architecture of the authoringprogram of the decision management system.

FIG. 5 is a flowchart illustrating the operation of a block editorwithin the authoring program.

FIG. 6 is a flowchart of a change screen layout procedure within theblock editor of FIG. 5.

FIG. 7 is a flowchart of an insert/edit component procedure within theblock editor of FIG. 5.

FIG. 8 is a flowchart of a main loop of the execution program thatcontinually executes during operation of the execution program.

FIG. 9 is a flowchart of a question sequence loop that operates withinthe main loop of FIG. 8.

FIG. 10 is a flowchart of a question sequencer procedure that operateswithin the question sequence loop of FIG. 9.

FIG. 11 is a flowchart of a process block procedure in the executionprogram for processing program blocks from the application program.

FIG. 12 is a flowchart of a resolve conditional procedure that operateswithin the process block procedure of FIG. 11.

FIG. 13 is a flowchart of a process block element procedure thatoperates within the process block procedure of FIG. 11.

FIG. 14 is a flowchart of a get answer procedure in the executionprogram for getting answers from user input and passing the answers onto other procedures within the program.

FIG. 15 is a flowchart of a show advice procedure that operates withinthe get answer procedure of FIG. 14.

FIG. 16 is a flowchart of an answer reference procedure in the executionprogram for checking for previous references to an answer.

FIG. 17 is a flowchart of a store accumulated result procedure in theexecution program.

DETAILED DESCRIPTION

A. Overview of the Decision Management System

A computer-assisted decision management system according to theinvention includes three major components. Referring to FIG. 1, onecomponent of the system is an authoring program 22 that an author 24uses for preparing a second component, an application program 26. Theseapplication programs can cover any number of subjects, such as educationof students, training of workers, the assembly of a legal document orthe rendering of a medical diagnosis. For assisting in understanding theinvention, reference may be made to a document assembly program as apreferred embodiment, although it will be understood by those skilled inthe art that the invention may be used in any number of fields such asmentioned above. A third component of the decision management system isan execution program 28 that executes or runs the application 30 forinteraction with a user 32.

1. The Authoring Program and Application Programs

FIG. 2 is a preferred embodiment of the visual interface 34 provided bythe authoring program 22. Although any number of interfaces arepossible, the interface 34 is preferred because it has proven to besimple for non-computer experts to learn and use to prepare applicationprograms 26. Shown within the interface are several windows that displayvarious data. Window 36 and window 38 comprise workspaces in whichblocks of the application 26 under development may be displayed andedited. The authoring program 22, as will be explained in detail below,places data including text, block references and conditional statementsinto application program blocks such as a question block displayed inwindow 36 and a help block containing advice explaining the question inwindow 38. The names of the blocks open in windows 36 and 38 arehighlighted in bars 37 and 39, respectively. Similarly, other types ofprogram blocks can be created such as answer blocks that containpossible answers to questions and context blocks that explain the importof each answer. The workspace environment is quite versatile and allowsmultiple windows to be open simultaneously.

The program blocks created for a particular application are accessiblethrough an index shown in windows 40 and 42. The index lists the namesof the program blocks on the display for selection by the user, foradding new program blocks, for opening a block for editing in theworkspace or for entry of a reference to an indexed block into an openblock. The blocks in an index are organized into block groups (shown inwindow 40) and blocks within a currently selected group (shown in window42). The name of the currently selected block group is highlighted inbar 44, and the name of the currently selected block is highlighted inbar 46.

For example, the question block in FIG. 2 contains a reference to aprogram block EE Reference shown in the index. Whatever name iscurrently in the EE Reference block will be shown in the question whenit is asked. The user will supply the EE name for the block in responseto an earlier question from the application program prompting for thename.

The author thus writes an application program by creating appropriateprogram blocks, naming them and then selecting and assembling suchblocks from the index in a desired order. Such selection includesselecting a conditional statement (such as an If-Then-Else statement)for insertion into a program block. The conditional statement isconstructed to accept a reference to another block as a condition forevaluation.

A detailed software description of the authoring program 22 is providedin section B, below. However, it will be understood by those skilled inthe art that the application programs 26 generated by authoring program22 or its method, as claimed, are not restricted to use solely with theexecution program 28. Nor is the execution program 28 or its method, asclaimed, restricted to use with the applications generated solely by theauthoring program 22.

2. The Execution Program and Application Programs

FIG. 3 is a block diagram of the software architecture of the otherportion of the decision management system, the execution program 28. Theprogram 28 runs on a host computer platform such as a microcomputer andis stored in a file system 48 within the computer. Through aquestion-and-answer dialogue managed by the program 28, a user 50controls the overall operation of the execution program 28 and executionof the application program 26.

The execution program comprises two main components: a sequence andcontrol module 52 and a virtual processor module 54. The control module52 manages the dialogue with the user 50 through various functions.These functions include managing the display of application output andthe sequence in which application questions are asked of the user 50.These functions further include managing the storage and retrieval offiles to and from the file system 48, and the scheduling of theapplication program's executable components on the virtual processormodule 54.

The virtual processor module 54 then executes the executable componentsof the application program 26, manages answers and other dynamic dataemployed in the execution and accumulates the output of the executionfor interaction with the user.

The application program 26 within the host platform is illustrated inFIG. 3 as a series of functional components. The components include asequence list component 55, a questions & blocks component 56, ananswers component 57 and an output component 58. Components 55 and 56are executable code in the application program 26. Answer component 57and output component 58 store data generated as a result of suchexecution. Components 55 and 56 are static data structures which areloaded from the application program 26 when the application is executed.The execution program 28 then creates dynamic data structures requiredfor the application's execution, including answers component 57 forstoring data entered by user 50 and output-component 58 for storingoutput data.

The execution program 28 thus is a computer-based method for assisting auser in making decisions in the process of completing a task defined bythe application program 26. In summary, in the process of executing theapplication program 26, the execution program 28 provides a set ofquestions for completing the task at hand. The user is asked a firstquestion from the set as the execution program 28 provides a choice ofanswers to the first question for the user. The execution program alsoprovides advice to the user for deciding which of the answers to thefirst question to select. This advice may take the form of help orcontext program blocks that can be accessed by user commands forexplaining the meaning or consequence of a question or answer.

The user's answer to the first question is recorded and a following,second question is asked from the question set. The content of thesecond question is determined at least in part by the user's answer tothe first question. The execution program 28 responds by providing achoice of-answers to the second question, one or more of the answersdetermined at least in part by the user's answer to the first question.The execution program 28 also provides advice to the user for decidingwhich of the answers to the second question to select, the advicedetermined at least in part by the user's answer to the first question.The second answer is also recorded. The above process is then repeatedwith other questions'in the question set until all questions material tocompleting the task are asked and answered. A detailed description ofthe operation of the execution program is provided in part C of thepatent.

To accelerate operation of the execution program, it is often desirableto ask the questions in the question set in a predetermined order. Thisensures that a question is not asked until all conditions precedent tothat question are met. For example, in FIG. 2, the question requires thename of the employee. Thus a question asking the employee's name wouldfirst be asked in executing the application so that the name isavailable to this question when it is asked.

In the preferred embodiment, the questions are asked and the answers andadvice are provided by displaying them on a computer display. However,they may also be asked in any number of ways, such as with audio orprinting devices.

The application program may also be set so that questions are asked inthe execution program only if conditions precedent to the asking of thequestion have been met. If such conditions have not been met, then thequestion is not asked unless invoked by the user directly or required byfollow-on logic.

In the preferred embodiment, the act of determining the second questionfrom the user's answer to the first question comprises incorporatinginformation from the answer into the second question.

Only material questions in the question set need to be asked. Whether aquestion is material is determined from one or more answers alreadygiven by the user to previously-asked questions. In some cases, theseanswers make the asking of the following question unnecessary orirrelevant.

The execution program can provide a suggested response if the user failsto answer a question. The suggested response may then be adopted by theuser as the answer. Alternatively, the execution program may require auser-provided answer to a question before proceeding with furtherquestions.

In the context of a document assembly system, the questions in thequestion set seek facts or determine provisions for inclusion into adocument. The method proceeds as described above, with the answersrepresenting facts or provisions for inclusion into the document, suchas shown in FIG. 2. The advice in such a system takes the form ofexplaining the significance of including an answer representing aprovision into the document.

B. Detailed Description of the Authoring Program and Applicationprograms

FIG. 4 is a diagram of the software architecture of the authoringprogram 22. The authoring program 22 provides several environments inwhich the author can work to accomplish different tasks involved in thecreation of a application program. From the opening screen of theinterface 34 on a display the author uses menu choices to select asub-environment 60 in which to work. The user can easily switch from anygiven environment to any other.

A block editor 62 is provided for manipulating program blocks and theircontents. With the block editor, the user 50 creates blocks 66 forholding data in the form of text, references to other blocks andconditional statements. The blocks that can be created include questionblocks for asking questions and answer blocks for accepting answers toquestions. As explained previously, blocks are the computational unitsor programs out of which all application-programs 26 are built. Blocksare organized into groups, and indexes 64 are maintained which list (1)all groups, and (2) for each group, all blocks 66 within that group asillustrated in FIG. 2.

For inserting a reference to an indexed block, a selection mechanismsuch as a cursor 63 is provided as an arrow in FIG. 2. Cursor 63 mayalso be used for inserting a conditional statement into the opened blockor other editing as well. The conditional statement is constructed toaccept a reference to an indexed block as a condition for evaluation.

The block & package tester 68 permits an author to examine the behaviorof all or part of a application program for a given set of inputs. Testresults 70 is a display of the actual output produced by such anexecution.

The sequence list builder 72 maintains in the sequence list 74 an idealorder in which the application questions should be asked of the user 50.

The application file creator 76 translates the application program 26into a simplified format appropriate for transfer to other computingplatforms. The translation is stored in the application file 78.

By selecting the exit authoring-program 80 choice, the user may quit theprogram.

As will be subsequently described, the block editor 62 of the authoringprogram is further constructed to create an answer block for holding ananswer to a question each time the authoring program creates a questionblock for asking a question.

The authoring program further includes a Qset editor (describedhereafter) for creating a help block for holding instructions foranswering a question and a context block for giving the context of aquestion each time the program creates a question block for asking aquestion. Procedures described herein then allow an author to insert andedit instructions and advice to the user. The Qset editor also creates aquestion condition lock in which conditions may be placed via an insertprocedure. If the conditions are met a question in an associatedquestion block will not be asked.

With the sequence list builder 72, the authoring program can requirethat questions in question blocks be asked in a predetermined sequence.

    ______________________________________    Authoring Program Environment Pseudocode    ______________________________________    While <true>    Case <menu choice>    "<block editor>"     block editor    "<block & package tester>"     block & package tester    "<sequence list builder>"     sequence list builder    "<application file creator>"     application file creator    "<exit>"     <quit the authoring program>    ______________________________________

1. BLOCK CONTENT MANAGER

The Block Content Manager comprises several sub-environments tomanipulate blocks and their contents. These are accessed with menuchoices.

With the block editor the author may open any block in the applicationand manipulate its contents.

Questions are maintained as groups of related blocks called "Qsets". The"Qset editor" is a superset of the block editor, allowing the authorsimultaneous edit access to several blocks of a given Qset.

Forms are groups of Qsets presented to the user as a single display. The"form editor" provides the author with an environment to manipulateforms.

    ______________________________________    Block Content Manager Pseudocode    ______________________________________    While <true>    Case <menu choice>     "<block editor>"      block editor     <Qset editor>"      Qset editor     "<form editor>"      form editor    ______________________________________

2. BLOCK EDITOR

Referring to FIG. 5, the block editor 62 is the primary environment inwhich the author works to create application programs 26. An applicationprogram includes one or more blocks. The blocks contain all of the textpassages and computational statements that comprise the applicationprogram. Blocks are created, manipulated and edited in the block editor62.

Blocks are organized into groups, and within the block editor, an indexof all groups, and an index of all blocks within a selected group may bedisplayed. At any given time one of the blocks may be open for editing.This is called the "open block", and its contents are displayed in ascrolling workspace where they may be manipulated. A different block maybe selected in the index, called the "current index block". Its group isthe "current index group". Most operations within the block editor thatpertain to blocks manipulate the open block and the current index block.

The block editor provides function selection through menu choices orother on-screen controls to manipulate blocks, manipulate blockcontents, manipulate the indexes, arrange the layout of the screen, andto select a different environment or quit the authoring program.

The "group & block manger" functions 82 handle creation, deletion andrenaming of blocks and groups. The "change screen layout" functions 84allocate screen space among the block editor's various displays. The"set current group & block" functions 86 select the current index blockand the current index group. The "open current block" function 88 opensthe current index block. The "insert/edit component" functions 90perform the actual editing of the open block's contents. The "authoringenvironments" functions 92 are the same choices available in allenvironments to move to a different environment or exit the authoringprogram.

    ______________________________________    Block Editor Pseudocode    ______________________________________    While <true>    Case <menu choice>    "<group & block manager>"     group & block manager    "<change screen layout"     change screen layout    "<set current group & block in index>"     set current group & block    "<open current block from index>"     open current block    "<insert/edit component of open block>"     insert/edit component    "<other authoring environments>"     authoring environments    ______________________________________

3. OSET EDITOR

Questions are implemented as a "question set" called a "Qset" a Qset isa set of blocks and other data structures which maintain the componentsrelated to any given question. The "Qset editor" permits the author tomanipulate several Qset components simultaneously.

The Qset editor is accessed with a menu choice which relies on thecurrent index block being a member of the Qset to be edited. Within theQset editor, the author may select between one and four of the Qset'sseven members for simultaneous display. The Qset members are the sixQset blocks: "question", "help", "context", "question condition","suggested answer" and "answer choice list", as well as the "answerformat" data structure.

If "answer format" is one of the members selected for display, thedisplayed dialogue will permit the author to set the type of the answer,to one of "text", "single choice", "multiple choice", "acknowledge","number", "date", "currency". The answer format dialogue also lets theauthor set whether any of the three "abstract answers" are permitted forthis Qset. The abstract answers are not actual values, but ratherproperties of an answer. If permitted by the author they may be chosenby the user in lieu of providing an actual value in answering aquestion. The three abstract answers are: "N/A" which generally lets theuser express that there will never be an answer to this question;"Blank" which lets the user request that a section of blank space besubstituted for an actual answer (for answers that will be inserted inoutput produced by the application, this allows the answers to be filledin while editing the final document); and "OK", which has no fixedmeaning (the application will typically interpret this answer based oninstructions to the user contained in the text of the question). If theauthor enables the "Blank" answer, then the author may pick one ofseveral character strings to be used as the blank section if the userpicks the "Blank" answer.

    ______________________________________    Qset Editor Pseudocode    ______________________________________    if <current index block is not Qset member>    return    <close index>    <enable Qset member selection dialogue>    while <true>           if <user requests change in Qset member display>            <adapt screen layout to request>           if <user placed cursor in Qset member block>            insert/edit component           if <user places cursor in answer format dialogue>            <enable user editing of answer format fields>    ______________________________________

4. GROUP & BLOCK MANAGER

Through menu choices within the block editor, the group & block manager82 gives the author access to six functions for creating, renaming anddeleting groups and blocks. These functions are discussed in thefollowing sections and include creating a block group, renaming a group,deleting a group, creating a block, renaming a block and deleting ablock.

    ______________________________________    Group & Block Manager Pseudocode    ______________________________________    While <true>    Case <menu choice>    "<create group>"     create group    "<rename group>"     rename group    "<delete group>"     delete group    "<create block>"     create block    "<rename block>"     rename block    "<delete block>"     delete block    ______________________________________

5. CREATE GROUP

A Create Group procedure presents the author with an edit box to capturethe name of the new group. The name is checked for validity, and the newgroup is created.

    ______________________________________    Create Group Pseudocode    ______________________________________    <solicit new group name dialogue>    if <name is valid>      <create the group>    Else      <display error message>    Return    ______________________________________

6. RENAME GROUP

The Rename Group presents the author with an edit box to capture a newname for an existing group. If the current index group is not a "system"group (whose name may not be changed), the name is checked for validity,and the new name is assigned to the group.

    ______________________________________    Rename Group Pseudocode    ______________________________________    If <selected group is a system group>      <display error message>      Return    <solicit new group name dialogue>    if <name is valid>      <rename the group>    Else      <display error message>    Return    ______________________________________

7. DELETE GROUP

The Delete Group procedure allows a user to delete a group from theapplication program. If the current index group is a non-deletable"system group", the authoring program displays an error message andterminates the operation. Otherwise, this procedure presents the authorwith a dialogue confirming the deletion. On confirmation, the currentindex group and all the blocks that belong to it are deleted.

    ______________________________________    Delete Group Pseudocode    ______________________________________    If <group is a "system group">     <error message>     Return    If <confirm delete>     <delete group's blocks>     <delete current index group>    Return    ______________________________________

8. CREATE BLOCK

The Create Block procedure presents the author with an edit box tocapture the name of the new block. The name is checked for validity, andthe new block is created within the current index group. If this is aQset group, the other blocks of the Qset are automatically created.

    ______________________________________    Create Block Pseudocode    ______________________________________    If <current index group is restricted>     <display error message>     Return    <solicit new block name dialogue>    if <name is invalid>     <display error message>     Return    <create the block>    If <current index group is Qset group>     <create other blocks of Qset>    Return    ______________________________________

9. RENAME BLOCK

The Rename Block procedure presents the author with an edit box tocapture a new name for the current index block. The name is checked forvalidity, and the new name assigned to the block. If the block was amember of a Qset, the other members names are correspondingly changed.All references within the application may be changed to conform to thenew block name.

    ______________________________________    Rename Block Pseudocode    ______________________________________    If <current index group or current index block is    restricted>     <display error message>     Return    <solicit new block name dialogue>    if <name is invalid>     <display error message>     Return    <rename the block>    If <current index group is Qset group>     <rename other blocks of Qset>    Return    ______________________________________

10. DELETE BLOCK

The Delete Block procedure presents the author with a dialogueconfirming the deletion. On confirmation, the current index block isdeleted. If the block was a member of a Qset, the other members are alsodeleted.

    ______________________________________    Delete Block Pseudocode    ______________________________________    If <confirm delete>     <delete the current index block>    If <current index group is Qset group>     <delete other blocks of Qset>    Return    ______________________________________

11. CHANGE SCREEN LAYOUT

Referring back to FIG. 5, a second group of functions within the blockeditor 62 is the Change Screen Layout functions 84. These functions aremade available to the author through a variety of menu choices and otheron-screen controls shown in FIG. 6. The "show/hide index" functions 106permit the user to display or erase from the screen the group index andthe index of the current index group's blocks. The "change open blocksize" function 108 permits the user to shrink or expand the screen sizeof the open block display 109, and to allocate screen space among theblock editor's windows in various proportions. The "Change Qset layout"procedure 110 handles the special case of screen allocation among themembers of a Qset.

    ______________________________________    Change Screen Layout Pseudocode    ______________________________________    Case <menu or control choice>    "<show/hide index>"     <show/hide index>    "<change open block size>"     <change open block size>    "<change Qset layout>"     change Qset layout    ______________________________________

12. INSERT/EDIT COMPONENT

Referring back to FIG. 5, this group of operations 90 is used by theauthor to accomplish the actual creation and editing of the contents ofthe blocks that comprise the application program. These operations arealways available to be performed within the block editor's open block,if there is one.

The operations 90 are shown specifically in FIG. 7. To "type changes andadditions to text" 118, the author selects text or places the cursor inthe open block and edits its contents using the common text editingfacilities. The open block is a scrolling window, so the extent of theblock's contents is not limited by the size of the screen window.

The "block reference" procedure 120 places a reference code to thecurrent index block at the cursor location in the open block.

The "conditional statement" procedure 122 conducts a dialogue with theauthor for either editing an existing conditional statement or forplacing a new conditional statement in the open block at the cursorlocation.

The "loop statement" procedure 124 conducts a dialogue with the authorfor either editing an existing loop statement or for placing a new loopstatement in the open block at the cursor location.

The "store statement" procedure 126 conducts a dialogue with the authorfor assigning a value to a given selected block in the index.

The "block exit statement" procedure 128 conducts a dialogue with theauthor for placing a block exit statement in the open block at thecursor location.

    ______________________________________    Insert/Edit Component Pseudocode    ______________________________________    Case <menu or control choice>    "<type changes or additions to text>"     <author: edit open block>    `<block reference>"     block reference    "<conditional statement>"     conditional statement    "<loop statement>"     loop statement    "<store statement>"     store statement    "<block exit statement>"     block exit statement    ______________________________________

13. BLOCK REFERENCE

The Block Reference procedure 118 in FIG. 7 is described in pseudocodebelow. To include a reference in the open block to another block, theauthor establishes the desired block as the current index block, setsthe cursor at the appropriate location in the open block, and then picksthe "Insert Block Reference" choice off the "Insert" menu within theblock editor. The authoring program responds by inserting an encodedreference to the current index block at the cursor location of the openblock.

    ______________________________________    Block Reference Pseudocode    ______________________________________    set current index block    <author: set cursor location in index block>    <menu choice: insert block reference>    <insert reference code>    ______________________________________

14. SET CURRENT INDEX BLOCK

The procedure for establishing a new current index block in the BlockReference procedure 118 is described in the pseudocode below. The authorfirst selects the correct group (if it's not already selected) from thegroup index. Second, the author selects the correct block from the blockindex (which always displays the blocks of the selected group). Theindexes are scrolling alphabetic lists of group names and block names.Selection is accomplished by clicking the mouse on the desired name. Theselected name is displayed in the title bar of the index window.

    ______________________________________    Set Current Index Block Pseudocode    ______________________________________    If <author: the current index group is not correct>      <author: select another group>    If <author: the current index block is not correct>      <author: select another block>    <display new current index group & block>    ______________________________________

15. INDEX VIEWER

Activating an "index viewer" on-screen control displays the contents ofthe current index block in a window. The display may not be edited. Thisfeature enables the author to rapidly view one block while editinganother. The index viewer control may optionally be "locked on", whichcauses the new current index block to be displayed each time it ischanged. This permits the author to glance at a sequence blocks with aminimum of manipulation.

    ______________________________________    Index Viewer Pseudocode    ______________________________________    set current index block    if <user selects index view control>      <display current index block in window>    if <user clicks mouse in window>      <close window>    ______________________________________

16. INSERT/EDIT CONDITIONAL

Referring to FIG. 7, the Insert/Edit Component procedure 90 includes aconditional statement procedure 122. To insert a new conditionalstatement with this procedure in the open block, the author starts byplacing the cursor 63 at the desired insertion point. To edit anexisting conditional statement, the cursor is placed anywhere within thefirst line of the existing conditional statement. The second step is forthe author to choose either "if-then" or "if-then-else" from the"insert" menu. Unless a conditional statement template is already open,the "open conditional statement template" 130 procedure is called. Aconditional statement may not nest another conditional statement withinitself, but may contain a reference to another block that does containan additional conditional statement.

    ______________________________________    Conditional Statement Pseudocode    ______________________________________    If <author: new conditional statement>      <author: place cursor at insertion point>    Else      <author: place cursor in first line of existing    conditional statement>    If <author: "if-then-else" type>      <menu choice: "if-then-else">    Else      <menu choice: "if-then">    If <no conditional statement template already open>      conditional statement template    ______________________________________

17. CONDITIONAL STATEMENT TEMPLATE

The Conditional Statement Template procedure referred to in thepseudocode above is described in detail in the pseudocode below. Inpreparation to opening the conditional statement template, the authoringprogram first invites the author to name a new, or rename an existing,conditional statement. The authoring program also gives the author theopportunity to change the form of the conditional statement between"if-then" and "if-then-else". Next the template is opened and displayedto the author, and then an "edit conditional statement" procedure iscalled. Controls are provided to close the template and to save theconditional statement defined by the contents of the template.

    ______________________________________    Conditional Statement Template Pseudocode    ______________________________________    <solicit conditional statement name>    <solicit change of conditional statement form    <open template>    edit conditional statement    If <author: save conditional statement>      <assemble & insert conditional statement in open block>    <close template>    ______________________________________

18. EDIT CONDITIONAL STATEMENT

To edit the content of a conditional statement, the authoring programdisplays a template that lays out each of the conditional statement'sthree components (conditional expression, "THEN" part, "ELSE" part) inits own editable scrolling window. The author may move freely among thethree components either with the tab key or by setting the cursor in anyof the three template windows.

The details of editing the conditional expression are handled in a"construct conditional expression" procedure.

Editing the "then" part as with any block contents is accomplished withthe "insert/edit component procedure 90", with the exception thatanother conditional statement may not be inserted into the contents ofthe "then" part.

If the conditional statement is of the "if-then-else" form, the authormay edit its "else" part, following the same rules as with the "then"part.

    ______________________________________    Edit Conditional Statement Pseudocode    ______________________________________    while <true>    If <author: edit conditional expression>      construct conditional expression    If <author: edit "then" part>      insert/edit component    If <"if-then-else" form>      If <author: edit "else" part>        insert/edit component    ______________________________________

19. CONDITIONAL EXPRESSION

A conditional expression is the component of a conditional statementthat performs a logical operation that reduces either to "true" or"false". The most common such operation is a comparison, and forapplication programs, the most common of these is a comparison betweenthe actual answer given by the user, and one of the possible answersprovided by the author.

The application program provides a special "answer test expression"constructor to handle this case. Other conditional expressions areconstructed like any other block contents, using the "insert/editcomponent" procedure.

To construct an answer test expression, the author first makes theanswer block (in which, at run time, the actual answer will be found)the current index block, and then chooses menu item "answer test" fromthe "insert" menu.

The authoring program will display a list of the possible answers whichthe author has provided for the given question, and the author picks theone to compare with the actual answer.

Next, the authoring program solicits from the user the type ofcomparison that should be applied between the possible and actualanswers.

After this, the authoring program asks the author whether the referenceto the actual answer in the comparison should be "active" or "passive".These behave the same if an answer exists at the time of the reference.But if there is no answer, an active reference will cause the questionto be asked at the time of the reference, while a passive referencesimply returns an indication that the answer is empty.

Finally, the authoring program assembles the answer test conditionalexpression and inserts it in the expression box of the template.

    ______________________________________    Conditional Expression Pseudocode    ______________________________________    If <author: wishes to construct custom expression>      insert/edit component      Return    If <author: wishes to construct answer test expression>      <author: set answer block in index with . . . >      set current index block      <menu choice: "answer test">      <display list of possible answers>      <author: pick answer to compare>      <display comparison types>      <author: pick comparison to use>      <ask author if answer reference is active or passive>      <author: select active or passive reference>      <assemble and insert answer test conditional expression      in box>    Return    ______________________________________

20. STORE STATEMENT

This procedure shown in FIG. 7 inserts a store statement at the cursorlocation. The Store statement permits the author to provide for theexplicit replacement with an arbitrary value of the contents of FACTblocks.

The block to be stored into must be the current index block. For thevalue to be stored, the author has three options. (1) Literal text whichthe author provides by typing or pasting. (2) A block reference which iscaptured through a special dialogue. (3) As an optimization of thegeneral block reference, an answer reference is captured with a simplerdialogue.

    ______________________________________    Store Statement Pseudocode    ______________________________________    case <menu selection>     <"store fact">      if <index group is not "fact">       return      <"store answer">      if <index group is not "answer">       return    case <store value dialogue result>     <"text">      <enter text in dialogue>     <"block reference">      block identification dialogue     <"answer reference">      answer identification dialogue    <insert store statement at cursor>    ______________________________________

21. BLOCK IDENTIFICATION DIALOGUE

The Block Identification Dialogue procedure detailed in the followingpseudocode is used by other procedures to solicit a needed blockidentity from the author when the index (typically used for thispurpose) is already committed to identifying some other block.

First, the dialogue presents the author with a list of all groups andsolicits the author to pick one. Second, the dialogue presents theauthor with a list of all blocks within the selected group and solicitsthe author to pick the desired block.

    ______________________________________    Block Identification Dialogue Pseudocode    ______________________________________    display group list    <solicit group selection from the author>    display selected group's block list    <solicit block selection from the author>    ______________________________________

22. ANSWER IDENTIFICATION DIALOGUE

The Answer Identification Dialogue noted in the above pseudocode is usedby other application program procedures to solicit a needed answeridentity from the author when the index (typically used for thispurpose) is already committed to identifying some other block.

The dialogue presents the author with a list of all answers and solicitsthe author to pick the desired one.

    ______________________________________    Answer Identification Dialogue Pseudocode    ______________________________________    display answer list    <solicit answer selection from the author>    ______________________________________

23. LOOP STATEMENT

The loop statement in FIG. 7 permits the author to include a loop in thecontents of a block. The author is presented with a template consistingof two parts to be completed. Completing the "conditional expression" isdescribed in the "construct conditional expression" procedure. The bodyof the loop is constructed in accordance with the "insert/editcomponent" procedure.

    ______________________________________    Loop Statement Pseudocode    ______________________________________    display loop template    if <user places cursor in conditional expression box.     construct conditional expression    if <user places cursor in loop body box.     insert/edit component    ______________________________________

24. APPLICATION TEST MANAGER

The Application Test Manager is a collection of procedures in theauthoring program 22 used by the author to check the behavior of theapplication. The "block tester" will execute any given block, and allthe blocks referenced from that origin. The "question tester" willpresent any of the application's questions along with all supportingfields.

    ______________________________________    Application Test Manager Pseudocode    ______________________________________    case <menu choice>    <"block tester">     block tester    <"question tester">     question tester    ______________________________________

25. BLOCK TESTER

An interpretive version of the execution program 28 is built into theauthoring program 22 as a block tester. The block tester runs any block(identified by the current index block) producing a displayed resultthat may be edited and saved in a file. The behavior of the executionwill be controlled by the answer set maintained by the authoringprogram. Any answers given during the execution will become part of thecurrent answer set.

    ______________________________________    Block Tester Pseudocode    ______________________________________    set current index block    run current index block    <display execution results in edit window>    <enable author to edit & file results>    ______________________________________

26. QUESTION TESTER

The author uses this procedure in the authoring program to present anyof the application's questions along with all supporting screens andfields, controlled by the state of the answer set maintained by theauthoring program. The question to ask is identified by an openingdialogue that has the author pick a Qset off a displayed list of allQsets in the application.

    ______________________________________    Question Tester Pseudocode    ______________________________________    display Qset list    <solicit author to select Qset from list>    display question run-time dialogue    <solicit author to interact with dialogue>    ______________________________________

27. SEQUENCE LIST MANAGER

This menu choice presents the author with a display of the sequence liststructures, which consist of two lists of Qset names: the sequence listand the unlisted Qset list. The display includes the necessary controlsto move names between the two lists, and to exit the sequence listmanager. The author controls the order of the sequence list. Theunlisted Qset list is always maintained in alphabetical order.

    ______________________________________    Sequence List Manager Pseudocode    ______________________________________    display sequence list structures    <author edits sequence list>    <author exits sequence list manager>    ______________________________________

28. INPUT/OUTPUT MANAGER

The input/output manager incorporates several input/output operationsaccessed through menu choices.

    ______________________________________    Input/Output Manager Pseudocode    ______________________________________    case <menu choice>    <"group lister">     group lister    <"Qset lister">     Qset lister    <"logic lister">     logic lister    <"help & notes window">     help & notes window    <"library builder">     library builder    <"application exporter">     application exporter    <"clear application">     clear application    <"import blocks">     import blocks    <"symbolic section number manager">     symbolic section number manager    <"search & replace">     search & replace    <"text window">     text window    ______________________________________

29. GROUP LISTER

This menu choice produces, in a window, a formatted display of thecontents of all blocks in the current index group. The display may beedited and saved to a file.

    ______________________________________    Group Lister Pseudocode    ______________________________________    set current index group    <display formatted listing in edit window>    <enable author to edit & file results>    ______________________________________

30. OSET LISTER

This menu choice produces, in a window, a formatted display of thecontents of all Qsets identified through a selection dialog. The displaymay be edited and saved to a file.

    ______________________________________    Qset Lister Pseudocode    ______________________________________    select scope of Qsets to list    <display formatted listing in edit window>    <enable author to edit & file results>    ______________________________________

31. LOGIC LISTER

This menu choice produces, in a window, a formatted display of thecomplete logical tree of processing permutations available from theorigin of the current index block. The display may be edited and savedto a file.

    ______________________________________    Logic Lister Pseudocode    ______________________________________    set current index block    <display formatted logic listing in edit window>    <enable author to edit & file results>    ______________________________________

32. HELP & NOTES WINDOW

The help & notes file is part of the authoring program 22 provided to anauthor. The file initially contains information on a variety of subjectsrelevant to the authoring process. The author may modify or augment thisfile to accumulate the author's own notes during authoring. This menuchoice opens the current help & notes file for editing. The author mayedit and save the file.

    ______________________________________    Help & Notes Window Pseudocode    ______________________________________    <open help & notes file>    <enable author to edit & file results>    ______________________________________

33. LIBRARY BUILDER

This menu choice creates a library file from the current index group. Alibrary file stores the contents of the group's blocks in a format thatenables the end user to modify the contents.

    ______________________________________    Library Builder Pseudocode    ______________________________________    set current index block    <create library file>    ______________________________________

34. APPLICATION EXPORTER

This menu choice creates an application export file for the application.This file contains the substance of the application in a format thatpermits the application to be transported to different computingplatforms.

    ______________________________________    Application Exporter Pseudocode    ______________________________________    <translate application to export format>    <write application export file>    ______________________________________

35. CLEAR APPLICATION

This menu choice erases all application dependent data structures. Theauthoring program 22 is returned to its initial empty state.

    ______________________________________    Clear Application Pseudocode    ______________________________________    <clear all application dependent data structures>    ______________________________________

36. IMPORT BLOCKS

This menu choice manages the copying of blocks from one application intoanother. From within the local application the author identifies througha dialog the remote application. The authoring program either importsthe entire remote application or displays the remote application'sindex, and the user selects the group or block to be moved. Further menuchoices move the selected group or block. The author exits the importblock operation by closing the remote index.

    ______________________________________    Import Blocks Pseudocode    ______________________________________    <display open dialog>    <author opens remote application>    <display remote application index>    while <remote index open>     set remote index block & group     <import block or group>    ______________________________________

37. SYMBOLIC SECTION NUMBERS

The symbolic section number facility of the authoring program manages adata base of symbols which may be arbitrarily inserted by the authorinto text within blocks. At run time these symbols will be convertedinto section numbers. Symbols are "declared" when they are placed at thelocation where the author expects them to be treated as actual numbersin a sequence of automatically assigned section numbers. Symbols are"referenced" when the author expects them to be replaced in the text bya section number declared elsewhere. Symbols may be referenced anywhere,but may be declared only in one location.

This menu choice displays a compound list of symbols identifying whichhave been already declared and which have been placed on the list butnot yet declared. On-screen controls enable the author to perform thefollowing symbol operations: (1) Add or delete a symbol from thecompound list; (2) Declare a symbol on the list to be a symbol for asection number to be generated (at run time) at the current cursorlocation in the open block; (3) Insert a reference (a symbol declaredelsewhere) at the current cursor location in the open block. At run timethe actual number will be substituted for the symbol; (4) Search allblocks for references to undeclared symbols; (5) Search all blocks foroccurrences of a given symbol.

    ______________________________________    Symbolic Section Numbers Pseudocode    ______________________________________    <display symbol lists>    case <user selected symbol operation>    "<add or delete symbol>"     <add or delete symbol>    "<declare symbol>"     <declare symbol>    "<insert reference>"     <insert reference>    "<search for an undeclared symbol>"     <search for an undeclared symbol>    "<search for a given symbol>"     <search for a given symbol>    ______________________________________

38. SEARCH & REPLACE

The authoring program 22 further provides the author with acomprehensive search and replace facility. The search & replace menuchoice presents a dialog with which the author selects either a textstring or a block reference as the subject for which to search. A seconddialog solicits from the author a choice between the open block and allblocks as the scope of the search. A third dialog determines whether theoperation should be a search or a replace. The search operation producesa search report which is displayed in a window, and may be edited andsaved in a file. The replace operation solicits the author for thereplacement text, and whether to employ the optional confirm step, andthen performs the replacement.

    ______________________________________    Search & Replace Pseudocode    ______________________________________    <present target select dialog>    if <target is string>    then <author enters search string>    if <target is block reference>    then <use current index block>    <present scope select dialog>    <present search/replace dialog>    if <operation is replace>    then    <solicit replacement text>    <ask whether to confirm>    <perform replacement>    else    <perform search>    <display search report>    <enable author to edit & file report>    ______________________________________

39. TEXT WINDOW

This menu choice enables the author to open, view, and edit any filewithout leaving the authoring program.

    ______________________________________    Text Window Pseudocode    ______________________________________    <present open dialog>    <display file in window>    <enable author to edit & save file>    ______________________________________

C. Detailed Description of the Execution Program and ApplicationPrograms

Major execution program procedures are described textually and bypseudocode below, in conjunction with a related flowchart. Individualprocedures are identified by a numeral. Actions taken within a procedureare identified by a numeral in parentheses.

1. Main Loon

As shown in FIG. 8 (Main Loop), the main execution loop of the executionsystem is structured as a case statement that handles requests by theuser. Main Loop is responsible for loading an application file,producing results for a user from the execution of an application file,manipulating specific files and exiting the execution system. Asindicated in FIG. 8 this list of tasks is not exhaustive.

With reference to the first step in Main Loop, the execution systemwaits for user action if no user request is pending (280). Once arequest is made, the main loop determines the nature of the request andbranches to the appropriate procedure to carry out the request. Theseprocedures, which include Question Sequence Loop 282, are described inthe flowcharts that follow FIG. 8. Main Loop is also the procedure inwhich the user asks for results (283).

    ______________________________________    Main Loop Pseudocode    ______________________________________    While <true>    If <user request not pending>    Then <wait for user request>    Case USER REQUEST    "<load application>"     question sequence loop    "<produce results>"     produce results    "<other requests>".     <other operations    "<exit>"     <quit the execution system>    ______________________________________

2. Question Sequence Loop

If the user requests the execution system to load an application program26, Main Loop loads the application 26 and then branches to the QuestionSequence Loop 282. Procedure 282 is shown in further detail in FIG. 9and includes several other procedures and a decision point. Procedure282 begins by calling a Question Sequencer 284 shown in FIG. 10 todetermine if there is another question on the sequence list to be asked.If there is another question, the procedure 282 calls Ask Questionprocedure 286 to ask the user the next question. If there is not anotherquestion, procedure 282 executes FirstBlock with the Process Blockprocedure, and then returns to Main Loop (FIG. 8). Procedure 282 alsoreturns to Main Loop if the user makes a general request (a requestoutside the scope of asking and answering questions).

    ______________________________________    Question Sequence Loop Pseudocode    ______________________________________    While <true>    question sequencer    If <there are no more questions>    Then Return    ask question    If <general user request pending>    Then Return    ______________________________________

3. Question Sequencer

The Question Sequencer procedure 284 in FIG. 10 determines if there isanother question yet to be asked of the user 260 in running applicationprogram 26. Running an application program in the execution program 28occurs in two stages. First, all of the questions on the sequence listthat should be asked are asked. This is the function of the QuestionSequencer Loop 282. Second, FirstBlock, the entry point to the executionsystem, is executed. Calling FirstBlock might result in more questionsbeing asked "on-the-fly," as will be described.

Procedure 284 determines the sequence of questions asked during thefirst stage, and determines when this stage is complete. It returns tothe Question Sequence Loop 282 either the identification of the questionto ask next (the current question,) or an indication that there are nomore questions to ask in this stage.

Assuming the normal sequence mode, the procedure 284 starts by examiningthe current question on the sequence list (288). If it is unanswered andnot suppressed by a Check Question Suppression procedure 89, or if it isanswered, but the status of the answer is below the threshold currentlyset by the user, then the ID of the current question is returned toprocedure 282 as the next one to be asked (290). If, on the other hand,the current question is unanswered but suppressed, or answered with astatus at or above the current threshold, the procedure 282 incrementsto the next question on the sequence list, and examines the new currentquestion (292).

When procedure 282 reaches the end of the sequence list, the executionsystem switches from "normal" to "tentative" sequence mode (294). Itproceeds as before, except that only questions marked as tentative areasked (296). All such tentative questions will sequentially andrepeatedly be promoted to the current question, and reasked, until theuser cancels the tentative status of all questions. At this point, thereare no more questions to be asked from the sequence list, and procedure284 returns this indication to the Question Sequencer Loop procedure 282(298).

    ______________________________________    Question Sequencer Pseudocode    ______________________________________    While <true>    Processing for tentative mode.    If SEQUENCE MODE = "<tentative>"     If <there are any tentative questions>     Then      Set CURRENT QUESTION To <next tentative question>      Return     Else      Set CURRENT QUESTION To <no more questions>      Return    Current question needs an answer and is not    - ask it.ed?    If <there is no answer to the current question>     and <the current question is not suppressed>    Then Return    - asknt question answered but status no good?     it    If <there is an answer to the current question>     and <answer status too low>    Then Return    Otherwise try next question.    <increment> CURRENT QUESTION    If <end of sequence list>    Then Set SEQUENCE MODE To <tentative>    TopOfLoop    ______________________________________

4. Check Question Suppression

Any question on the sequence list may be guarded by a "questioncondition." This is an optional program written by the author andcontained in the question's data structure. Each question on thesequence list will be asked, in order, unless the question is suppressedby its own "question condition" program.

The Check Question Procedure 289 runs the current question's "questioncondition" program to determine whether the question should be asked orsuppressed. The procedure begins by determining if a "questioncondition" block exists for the current question. If not, the procedurereturns a "<don't suppress>" to Question Sequencer 284.

If a "question condition" program does exist for the current question,procedure 284 passes the "question condition" ID as a parameter to aProcess Block procedure (to be described) and-then calls that procedure.If the result of calling Process Block is false (the question'sconditions are not yet met), the procedure 289 returns "do suppress" toprocedure 284. If the procedure 302 does not return false (thequestion's conditions have been met), procedure 289 returns "don't

    ______________________________________    Check Question Suppression Pseudocode    ______________________________________    If <question condition does not exist>    Then Return "<don't suppress>"    process block (<question condition block ID>)    If <accumulated result> = "<false>"    Then Return "<do suppress>"    Else Return "<don't suppress>"    ______________________________________

5. Process Block

A block, whether it is a "question condition" block or other block inthe application program 26, is a data structure consisting of a list ofelements. Each element is an instruction intended for execution onvirtual processor module 54. All the elements together comprise theblock's virtual program. The Process Block procedure is the component ofvirtual processor module 54 that determines which block element toexecute next, and what information returns when the block's program hasrun to completion.

The Process Block procedure is shown in FIG. 11. It first checks to seethe block program it is processing is finished, i.e., it encounters anexit block element signalling the block's end (300). If not, it selectsthe next element of the block program and determines how it should betreated (304). If the element is a conditional statement, the ProcessBlock procedure calls a Resolve Conditional procedure (306). If theelement is not a conditional statement, the Process Block procedurecalls a Process Block Element procedure (308). The results of theseprocedures are returned to Process Block procedure. The Process BlockElement procedure is responsible for the actual execution of theelements. The result of element execution is the accumulation of resultsin a data structure called Accumulated Result. Accumulated Result isused by many procedures, including Get Question.

    ______________________________________    Process Block Pseudocode    ______________________________________    If <next block element> = <exit block>    Then return    select next element    If <next block element> = <conditional statement>    Then     resolve conditional     TopofLoop    process block element    ______________________________________

6. Resolve Conditional

A conditional statement comprises three components: a conditionalexpression, a Then component, and an Else component. The Else componentmay be empty. The Then and Else components are each groups of blockelements. After executing either of these groups, processing continueswith the block element following the entire conditional statement. TheResolve Conditional procedure illustrated in FIG. 12, evaluates aconditional expression of a conditional statement within a block programfor true or false. Based on this evaluation, the procedure identifiesthe first element of either the Then or Else component to theconditional statement as the next element to be executed.

    ______________________________________    Resolve Conditional Pseudocode    ______________________________________    If <evaluate conditional expression>    Then Set <next block element> To <first element of <then>    component>    Else    If <conditional statement includes <else> component>    Then     Set <next block element>     To <first element of <else> component>    Else     Set <next block element>     To <first element following conditional statement>    Return    ______________________________________

7. Process Block Element

As noted above, the Process Block Element procedure is responsible forexecuting the elements of a block program. The results of such executionis accumulated into a data structure called Accumulated Result. For eachelement whose execution produces a result, that result is appended tothe preexisting result within the Accumulated Result procedure shown inFIG. 17. This Accumulated Result is emptied by a procedure StoreAccumulated Result into the calling procedure, here the Process Block.FIG. 13 illustrates the operation of the Process Block Elementprocedure.

The Process Block Element procedure is essentially a case statement witha case for each element type.

A text element is a descriptor which identifies a fixed block of text.Its execution appends that text to the Accumulated Result. Answerreference elements are elements that involve a more detailed analysis,for which a procedure Answer Reference is called. Execution of a blockreference element results in a recursive call on procedure ProcessBlock. Any result produced by the recursive procedure is appended to theAccumulating Result.

    ______________________________________    Process Block Element Pseudocode    ______________________________________    Case <element type>    "<text>"     <accumulate text into result>    "<answer reference>"     answer reference (<question ID>)    "<block reference>"     process block (<block id>)    .    .    Return    ______________________________________

8. Answer Reference

This procedure is called by the Process Block Element procedure and asksif the current question has an answer stored and, if yes, if theexisting answer has a status at or above a current threshold. If so, theprocedure appends the answer to the Accumulated Result. If not, theprocedure calls the Ask Question procedure.

    ______________________________________    Answer Reference Pseudocode    ______________________________________    If <no current answer>     or <answer below current threshold>    Then ask question    <append answer to accumulated result>    ______________________________________

9. Ask Question

This procedure is called by the Question Sequence Loop 282 of FIG. 9,and by the Answer Reference procedure. It asks the identified questionof the user and captures the user's answers. The Ask Question Procedurecomprises calls to three other procedures: Generate Question, PresentQuestion, and User Answer.

    ______________________________________    Ask Question Pseudocode    ______________________________________    generate question    present question    user answer    Return    ______________________________________

10. Generate Question

The Generate Question procedure produces text strings that, whendisplayed to the user, constitute asking the question. Three of thesestrings are produced by calling three procedures in Generate Question.Get Question constructs the text of the question itself. Get Prompthandles the construction of the list for multiple choice type questions.Retrieve Current Answer secures the text of a previous answer, or whereappropriate, a suggested answer. The result of executing the GenerateQuestion procedure is a data structure made up of these three textstrings returned to the Ask Question procedure.

    ______________________________________    Generate Question Pseudocode    ______________________________________    get question    get prompt    retrieve current answer    ______________________________________

11. Get Question

This procedure produces the text of a question. A question's text isrepresented as a program contained in a data structure called theQuestion Block. For a given question, this block is identified by anumber. In the Get Question procedure, the question block's identifyingnumber is passed as a parameter to Process Block which runs the programin Question Block. The result of executing the Process Block procedureis the production of text. When Process Block returns, this text isstored into the question string, by calling Store Accumulated Resultwith the question string passed as a parameter to Accumulated Result.

    ______________________________________    Get Question Pseudocode    ______________________________________    process block(<question block ID>)    store accumulated result(<question string ID>)    ______________________________________

The accumulated result in the Get Question procedure is returned to theGenerate Question procedure. At this point the text of the question asgenerated by any preexisting result is at hand. The Generate Questionprocedure then calls the Get Prompt procedure.

12. Get Prompt

This procedure produces the text of a question's prompt. For multiplechoice type questions, the prompt specifies the list of choicespresented to the user. A prompt's text is represented as a programcontained in a data structure called the Prompt Block. For a givenprompt, this block is identified by a number. The prompt block'sidentifying number is passed as a parameter to Process Block which runsthe program. The result of this execution is the production of textwhich is also stored in the data structure Accumulated Result. When theProcess Block procedure returns, this accumulated result is stored intothe prompt string, by calling Store Accumulated Result with the promptstring passed as a parameter.

    ______________________________________    Get Prompt Pseudocode    ______________________________________    process block(<prompt block ID>)    store accumulated result(<prompt string ID>)    Return    ______________________________________

The last procedure called in the Generate Question procedure is theRetrieve Current Answer procedure.

13. Retrieve Current Answer

This procedure is responsible for reporting back with a given question'scurrent answer, if it has one, and if there is no answer, reporting backthat the answer is empty. This is distinguished from the AnswerReference procedure which will spontaneously ask the question if itfinds the answer empty.

Note that the abstract answer "declined" is a bona fide answer, distinctfrom the empty answer.

If an answer exists it is placed in the question's answer string, andthe procedure returns.

If this call arose through a call on Ask Question, the motive is todisplay the most helpful representation of the current answer to theuser to help the user in selecting the user's own answer. To this end,if there is no answer, but a suggested answer program has been providedby the author for this question, then the suggested program is runthrough a call to Process Block and the Accumulated Result. The text ofthe suggested answer is then placed into the answer string andsubsequently displayed to support the user in answering the question.

If this call arose from a Retrieve Current Answer in a block program,this indicates that the application is trying to determine if the userhas answered the question. Substituting the suggested for an emptyanswer in this case would be misleading, and the answer string is set toempty.

    ______________________________________    Retrieve Current Answer Pseudocode    ______________________________________    If <a real answer exists>     <store the answer in the answer string>     Return    If <call arose in a block program>     <store <empty> into the answer string>     Return    process block (<default block ID>)    store accumulated result (<answer string ID>)    Return    ______________________________________

The result of calling these three procedures and the procedures theycall is to generate and return to the Ask Question procedure the datastructures necessary to present a question to the user.

The Ask Question procedure then calls the Present Question procedure.

14. Present question

This procedure is responsible for presenting questions to the user inone of two forms, depending on the display mode. In the spreadsheetmode, the questions are presented in a compact format that compresseseach question and current answer into a single line of a scrollingpresentation. The current question is identified in the presentation. Inthe question mode, the current question, prompt and answer choices aredisplayed in full on the screen. The Present Question procedure thenreturns to the Ask Question procedure.

    ______________________________________    Present Question Pseudocode    ______________________________________    If DISPLAY MODE = <spreadsheet>    Then     <display spreadsheet>     <identify current question on spreadsheet>    Else     <display question>     <display prompt if appropriate>     <display existing or suggested answer if appropriate>    Return    ______________________________________

The Ask Question procedure then calls the User Answer procedure.

15. User Answer

This procedure analyzes and stores an answer or certainty changeprovided by the user in response to the presented question. A certaintychange is recorded in the certainty level field of the question datastructure. An answer is recorded in the answer string field of thequestion data structure.

Any of the three abstract answer types (declined, blank, OK) arerecorded in the answer string field of the question data structure. TheAsk Question procedure then returns the answer to the Answer Referenceprocedure, which appends it to the data structure Accumulated Result.

    ______________________________________    User Answer Pseudocode    ______________________________________    Case <answer type>    "<certainty change>"     <record new certainty level>    "<ordinary answer>"     <record new answer>    "<declined>"     <mark answer <declined>>    "<blank>"     <mark answer <blank>>    "<OK>"     <mark answer <OK>>    Return    ______________________________________

16. Get Answer

This procedure, illustrated in FIG. 14, processes user activity whileawaiting a user answer to a presented question. The structure is a casestatement within an endless loop.

The Get Answer procedure will process repeated user requests related tosecuring an answer until an answer is finally given via User Answerprocedure. At this point the Get Answer procedure calls the User Answerprocedure to analyze and store the answer.

If the user requests a service unrelated to providing an answer (ageneral user request) the procedure returns back to the executionsystem's main loop where these requests are handled.

Request for display of advice, "help" and "context," are handled by aShow Advice procedure 338 to be described. On return, Get Answercontinues.

If the user changes the display mode between the full questionpresentation and the spreadsheet, the Present Question procedure iscalled to present the correct display, after which Get Answer continues.

If the user requests a marking operation, this is accomplished by aMarking Operations procedure 340. Upon return, Get Answer continues.

Changes to an answer's certainty are handled (as with changes to theanswer) by the procedure User Answer 322. But after returning from acertainty change Get Answer continues, rather than returning.

Any other user action is ignored, and Get Answer continues.

    ______________________________________    GET ANSWER PSEUDOCODE    ______________________________________    While <true>    Case <user action>    "<answer>"     user answer     Return    "<general user request>"     Return    "<advice request>"     show advice     TopofLoop    "<change display mode>"     present question     TopofLoop    "<marking request>"     marking operations     TopofLoop    "<change certainty request>"     user answer     TopofLoop    <any other value>     TopofLoop    ______________________________________

17. Show Advice

This procedure, shown in FIG. 15, is called when the user requestsadvice to assist in the answering of a question. First the proceduredetermines whether the user requested "help" advice or "context" advice,and then calls Process Block 302, passing as a parameter the appropriate(help or context) block identifier belonging to the current question(342, 344). On return from Process Block, the accumulated result isdisplayed for the user (346), and Show Advice 338 returns to its caller.

    ______________________________________    Show Advice Pseudocode    ______________________________________    If <advice type requested> = <help>    Then process block (<help block ID>)    Else process block (<context block ID>)    <display accumulated result>    Return    ______________________________________

20. Marking Operations

This procedure allows the user to select a group of questions andperform one of several operations on the selected group. Depending onthe category of the marking operation, the procedure allows a user toidentify a group to be marked or to manipulate a marked group in themanner listed.

    ______________________________________    MARKING OPERATIONS PSEUDOCODE    ______________________________________    If <marked group identification operation>    Case <operation type>           "<(un)mark current question>"                           <. . . >           "<(un)mark all>"                           <. . . >           "<invert marks>"                           <. . . >           "<show/hide marks>"                           <. . . >           "<mark unanswered>"                           <. . . >           "<mark old answers>"                           <. . . >           "<mark new answers>"                           <. . . >           "<mark double checked>"                           <. . . >           "<mark tentative>"                           <. . . >           "<mark untentative>"                           <. . . >           "<mark declined>"                           <. . . >           "<mark blank>"  <. . . >           "<mark OK>"     <. . . >    Else -- must be <marked group manipulation operation>    Case <operation type>           "<load answers/notes file>"                           <. . . >           "<save answers/notes file>"                           <. . . >           "<clear answers/notes>"                           <. . . >           "<asked only marked                           <. . . >           questions>"    Return    ______________________________________

D. The Integrated System

As described above, the major components of the computer-assisteddecision management system are the authoring program 22, theapplications 26 and the execution program 28. A unique feature of thisinvention is the division of programming labor among the components.

The execution program 28 is best described as a virtual processor,engineered on the model of a computer but implemented in software. Theblocks and other data structures produced by an author are in effect thesource code, compiled with the authoring program 22 into applications 26which then run on the execution program 28.

The system divides the programming labor so that the author has maximumfreedom in incorporating knowledge into the applications. But the authoris not concerned with programming many ordinary aspects of a computerimplementation usually required to be specified by an applicationauthor. The execution program 28, as a virtual processor, implementsevery aspect of an application that is not essential to the author'srole as knowledge contribution. The result is that applications 26 areconcise structures not complete applications in any conventional sense.An application has content, but a substantial portion of theapplication's behavior--the way it is displayed and reacts to userinput--is contributed directly by the virtual processor and need not beprogrammed by the author.

Specifically, the application 26 contributes all the questions which maybe asked during its execution and the rules which control what questionsare asked, in what form, and in what order. The program logic of theapplication also determines text displayed to the user as questions,prompts, choice lists, tags, application advice and application context.The program logic further determines results provided.

The virtual processor contributes all screen, keyboard, mouse, filemanagement actions and all controls necessary for the user to manageevery aspect of the application's execution. The processor creates thedifferent display environments including a central control panel, aquestion display, a spreadsheet display, a results display, etc. Allstring management is handled by the virtual processor as well as a fullcomplement of file operations for reading and writing application,answer, notes, marks and results files. This includes the ability toselect any file, directory or disk by picking choices from lists.

Finally, the virtual processor controls the execution of theapplication, which follows rules and logic specified in the applicationto govern the order and form of question presentation and theformulation of text for screen presentation and results.

Having described and illustrated the principles of the invention withreference to preferred embodiments and several variations thereon, it isapparent that such embodiments can be modified without departing fromsuch principles. For example, many of the procedures herein may berewritten and yet be equivalent in operation and function.

In view of these and the wide variety of other embodiments to which theprinciples of the invention can be applied, the illustrated embodimentsshould be considered exemplary only and not as limiting the scope of theinvention. We therefore claim as the invention all such modifications asmay come within the scope and spirit of the following claims andequivalents thereto.

We claim:
 1. A method for creating application programs for acomputer-assisted decision management system, comprising:providing dataincluding text, block references and conditional statements in programblocks addressable by unique names, a conditional statement within aprogram block constructed to accept a reference to another program blockas a condition for evaluation; providing answer choices for theapplication program in program blocks; listing the names of programblocks on a display for selection; and in response to selection ofprogram blocks by an author, assembling the selected program blocks intoa desired order to create an application program.
 2. Acomputer-implemented authoring tool for creating an application for adocument assembly system, comprising:a computer: a block editor storedin the computer for creating blocks for holding data in the form oftext, references to other blocks and conditional statements, the blocksincluding question blocks for asking questions, answer choice blocks foraccepting answers to questions, suggested answer blocks to providesuggested answers, question condition blocks to suppress the asking ofinappropriate questions, help and context blocks to hold help orcontext, processing blocks to hold the logic of result processing, factblocks to hold value assignments, and blocks to manage loop structures;an index stored in the computer for listing blocks created for theapplication; a workspace stored in the computer for entering the datainto an opened block from the index; a selection mechanism stored in thecomputer for inserting a reference to an indexed block into the openedblock; and a selection mechanism stored in the computer for inserting aconditional statement into the opened block, the conditional statementconstructed to accept a reference to an indexed block as a condition forevaluation.
 3. The authoring tool of claim 2 including means forcreating an answer block for holding an answer to a question each timethe block editor creates a question block for asking a question.
 4. Theauthoring tool of claim 2 including means for creating a help block forholding instructions for answering a question and a context block forgiving the context of a question each time the block editor creates aquestion block for asking a question.
 5. The authoring tool of claim 2including means for creating a question condition block for containingconditions that must be met before a question in an associated questionblock is asked.
 6. The authoring tool of claim 2 including means forasking questions in questions blocks in a predetermined sequence.
 7. Amethod for creating an application for a computer-assisted decisionmanagement system, the method comprising the following steps:creating aset of question procedures for the application for asking questions of auser, one or more of the questions procedures containing a reference toa referenced procedure; creating a referenced procedure for a questionprocedure, the referenced procedure generating content literallydifferent from but based on an analysis of one or more previous answersentered by a user in response to a question, the referenced procedureproviding the content to the question procedure for use in generating aquestion; and storing the set of question procedures and referencedprocedure on a computer-readable medium.
 8. The method of claim 7including creating a set of answer procedures for the application forgenerating answer choices for a user, one or more of the answerprocedures containing a reference to a referenced procedure thatgenerates content literally different from but based on an analysis ofone or more previous answers entered by a user in response to aquestion, the referenced procedure providing the content to the answerprocedure for use in generating an answer choice.
 9. The method of claim7 wherein a question procedure contains references to multiplereferenced procedures.
 10. The method of claim 7 wherein a referencedprocedure contains a reference to another referenced procedure.
 11. Themethod of claim 7 wherein a referenced procedure includes a conditionalstatement that chooses a result from a group of possible results basedon one or more previous answers entered by a user.
 12. The method ofclaim 7 including creating a set of advice procedures for theapplication for advising a user with respect to a question, one or moreof the advice procedures containing a reference to a referencedprocedure that generates content literally different from but based onan analysis of one or more previous answers entered by a user inresponse to a question, the referenced procedure providing the contentto the advice procedure for use in generating advice.
 13. The method ofclaim 7 wherein the reference in the question procedure is a call to thereferenced procedure.
 14. The method of claim 7 wherein the decisionmanagement system is a document assembly system.
 15. Acomputer-implemented apparatus for creating an application for acomputer-assisted decision management system, comprising:means forcreating a set of question procedures for the application for askingquestions of a user, one or more of the questions procedures containinga reference to a referenced procedure; means for creating a referencedprocedure for a question procedure, the referenced procedure generatingcontent literally different from but based on an analysis of one or moreprevious answers entered by a user in response to a question, thereferenced procedure providing the content to the question procedure foruse in generating a question; and means for storing the set of questionprocedures and referenced procedure on a computer-readable medium. 16.The apparatus of claim 15 including means for creating a set of answerprocedures for the application for generating answer choices for a user,one or more of the answer procedures containing a reference to areferenced procedure that generates content literally different from butbased on an analysis of one or more previous answers entered by a userin response to a question, the referenced procedure providing thecontent to the answer procedure for use in generating an answer choice.17. The apparatus of claim 15 wherein a question procedure containsreferences to multiple referenced procedures.
 18. The apparatus of claim15 wherein a referenced procedure contains a reference to anotherreferenced procedure.
 19. The apparatus of claim 15 wherein a referencedprocedure includes a conditional statement that chooses a result from agroup of possible results based on one or more previous answers enteredby a user.
 20. The apparatus of claim 15 including means for creating aset of advice procedures for the application for advising a user withrespect to a question, one or more of the advice procedures containing areference to a referenced procedure that generates content literallydifferent from but based on an analysis of one or more previous answersentered by a user in response to a question, the referenced procedureproviding the content to the advice procedure for use in generatingadvice.
 21. The apparatus of claim 15 wherein the reference in thequestion procedure is a call to the referenced procedure.
 22. Theapparatus of claim 15 wherein the decision management system is adocument assembly system.
 23. A method for creating an application for acomputer-assisted decision management system, the method comprising thefollowing steps:creating a set of question procedures for theapplication for asking questions of a user, one or more of the questionsprocedures containing a reference to a referenced procedure; creating areferenced procedure for a question procedure, the referenced proceduregenerating content for the question based on an analysis of one or moreprevious answers given by a user in response to a question; and storingthe question procedures and referenced procedure on a computer-readablemedium.
 24. A computer-implemented apparatus for creating an applicationfor a computer-assisted decision management system, comprising:means forcreating a set of question procedures for the application for askingquestions of a user, one or more of the questions procedures containinga reference to a referenced procedure; means for creating a referencedprocedure for a question procedure, the referenced procedure generatingcontent for the question based on an analysis of one or more previousanswers given by a user in response to a question; and means for storingthe question procedures and referenced procedure on a computer-readablemedium.